import { Entity, PrimaryGeneratedColumn, Column, OneToMany } from "typeorm";
import { Item } from "@/entity/item";

@Entity('user')
export class User {

  @PrimaryGeneratedColumn()
  id!: number;

  @Column()
  firstName!: string;

  @Column()
  lastName!: string;

  @Column({ unique: false })
  email!: string;

  @OneToMany(type => Item, item => item.user)
  items!: Item[];

  @Column("blob", { nullable: true })
  header?: Uint8Array;

}